}
/**
- * Call a legacy AuthPlugin method, if necessary
+ * This used to call a legacy AuthPlugin method, if necessary. Since that code has
+ * been removed, it now just returns the $return parameter.
+ *
* @codeCoverageIgnore
* @deprecated For backwards compatibility only, should be avoided in new code
* @param string $method AuthPlugin method to call
* @return mixed Return value from the AuthPlugin method, or $return
*/
public static function callLegacyAuthPlugin( $method, array $params, $return = null ) {
- global $wgAuth;
-
- if ( $wgAuth && !$wgAuth instanceof AuthManagerAuthPlugin ) {
- return $wgAuth->$method( ...$params );
- } else {
- return $return;
- }
+ wfDeprecated( __METHOD__, '1.33' );
+ return $return;
}
/**
if ( $block ) {
$errorParams = [
$block->getTarget(),
- $block->mReason ?: wfMessage( 'blockednoreason' )->text(),
+ $block->getReason() ?: wfMessage( 'blockednoreason' )->text(),
$block->getByName()
];
// Is the IP user able to create accounts?
$anon = new User;
- if ( !$anon->isAllowedAny( 'createaccount', 'autocreateaccount' ) ) {
+ if ( $source !== self::AUTOCREATE_SOURCE_MAINT &&
+ !$anon->isAllowedAny( 'createaccount', 'autocreateaccount' )
+ ) {
$this->logger->debug( __METHOD__ . ': IP lacks the ability to create or autocreate accounts', [
'username' => $username,
'ip' => $anon->getName(),
// Inform the providers
$this->callMethodOnProviders( 6, 'autoCreatedAccount', [ $user, $source ] );
- \Hooks::run( 'AuthPluginAutoCreate', [ $user ], '1.27' );
\Hooks::run( 'LocalUserCreated', [ $user, true ] );
$user->saveSettings();